1. Field of the Invention
The present invention generally relates to caching. More particularly, the present invention provides a method, system and program product for reducing the overhead of cache invalidations in a shared cache (e.g., a cache cluster) by transmitting a hashed code of a key to be invalidated rather than the entire key.
2. Related Art
Caching is used in many systems to reduce access time to data. In a clustered environment, caches are often distributed among multiple systems in a cluster. A group of caches in a cluster that all cache the same data are called “peers.” To provide cache consistency among peers, caches may send invalidation messages to their peers when an object associated with a key is modified or deleted from the cache.
Sending an invalidation to peers in current shared cache systems involves sending the entire key of the object to be invalidated. In Java, as shown in the flow diagram of FIG. 1, this is typically done by serializing the key (step S1), transmitting the serialized version of the key to each peer (step S2), and deserializing the received serialized version of the key at each peer (step S3). The key received by each peer is subsequently discarded from the cache (step S4). Unfortunately, there is a processing overhead in the serialization/deserialization of the key. Further, the entire key must be transmitted, which consumes extra network bandwidth. As such, there is a need to reduce the processing and bandwidth overhead of cache invalidations in a shared cache.